<?php 
class OrderAction extends BaseAction {
	
	public function index(){

		$id = $_GET['id'];
		$Product = D('Product')->find($id);
		$this->assign('product', $Product);
        $this->display();
	}
	public function check() {
		
		$order = D('Order');
		if($order->create()){
			$order->uid = $_SESSION[C('USER_AUTH_KEY')];
			$order->postdate = time();
			if($order->add()){
				$this->assign('jumpUrl', 'address');
				$this->success(L('_INSERT_SUCCESS_'));
            }else{ 
                $this->error(L(_INSERTFAIL)); 
            } 
		}
	}
	
}
?>